// component/order-plan/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    role: {
      type: String,
      value: "",
  },
  },

  /**
   * 组件的初始数据
   */
  data: {
    // role:'1',
    active: 0

  },

  /**
   * 组件的方法列表
   */
  methods: {
		onChange(e) {
      this.setData({
        active: e.detail.index
      });
    },
    onPullDownRefresh() {
			if(this.data.active==0){
				const planing = this.selectComponent('.planing');
					planing.onPullDownRefresh && planing.onPullDownRefresh()
			}else{
				const had_plan = this.selectComponent('.had_plan');
					had_plan.onPullDownRefresh && had_plan.onPullDownRefresh()
			}
    },
    onReachBottom() {
			if(this.data.active==0){
				const planing = this.selectComponent('.planing');
					planing.onReachBottom && planing.onReachBottom()
			}else{
				const had_plan = this.selectComponent('.had_plan');
					had_plan.onReachBottom && had_plan.onReachBottom()
			}
    },
  }
})
